﻿@model MVCDropDownList.Models.Calendar

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<form id='CalendarForm' method="post" action="/Home/Index">
<h2>Index</h2>
@Html.LabelFor(model=>model.Month)
@Html.DropDownListFor(model => model.Month, Model.Months, new { @ID = "ddlMonths" })

You Have Selected: 
<label>
@{ 
if (Model.Month != null)
{
   @Model.Month.ToString()
}                                                                   
}
</label>
<br/>
@Html.DropDownListFor(model => model.SelctedMonth,
                                new[]{
                                 new SelectListItem(){Text="January", Value="jan"},
                                 new SelectListItem(){Text="February", Value="feb"}
                                }, "select one", new { @ID = "ddlmonthType" })

You Have Selected: 
<label>
@{ 
if (Model.SelctedMonth != null)
{
   @Model.SelctedMonth.ToString()
}                                                                   
}
</label>

<br />
@*<a href="" id="btnSubmit">submit</a>*@
<input type="Submit" id="btnSubmit" />
</form>
@*<script type="text/javascript">
    $(document).ready(function () {
        $('#btnSubmit').click(function () {
            $('#btnSubmit').val = 'Save';
            $('#CalendarForm').submit();
        });
    });
</script>*@

